package com.joshua.spring.entity.em;

import com.joshua.spring.exception.ExceptionEnumInter;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * projectName feign-test
 * package com.joshua.spring.entity.em
 * classname  UserResponse
 * <p>
 * description
 * </p>
 *
 * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
 * @date 2020/11/8 21:36
 */
@Getter
@AllArgsConstructor
public enum UserResponse implements ExceptionEnumInter {
    //用户
    NULL_USERNAME_PWD("A0110", "用户名或密码校验失败", HttpStatus.UNAUTHORIZED),
    ERROR_VERIFY_CODE("A0130 ", "无效的校验码", HttpStatus.BAD_REQUEST),
    NULL_PHONE_NUM("A0151", "手机号格式校验失败", HttpStatus.BAD_REQUEST),
    NULL_EMAIL("A0153", "邮箱格式校验失败", HttpStatus.BAD_REQUEST),
    USER_NOT_FOUND("A0201", "用户账户不存在", HttpStatus.UNAUTHORIZED),
    AUTHORITY_EXCEPTION("A0300 ", "访问权限异常", HttpStatus.UNAUTHORIZED),
    AUTHORITY_FORBIDDEN("A0301 ", "访问未授权", HttpStatus.UNAUTHORIZED),
    TOKEN_EXPIRE("A0311 ", "授权已过期", HttpStatus.UNAUTHORIZED),
    ILLEGAL_REQUEST_PARAM("A0400", "请求参数错误", HttpStatus.BAD_REQUEST),
    UNAUTHORIZED("A0401", "未认证", HttpStatus.UNAUTHORIZED),
    FORBIDDEN("A0403", "非法请求", HttpStatus.FORBIDDEN),
    METHOD_NOT_ALLOW("A0405", "错误的Http请求方式", HttpStatus.METHOD_NOT_ALLOWED),
    USER_REQUEST_SERVER_FAIL("A0500", "用户请求服务异常", HttpStatus.INTERNAL_SERVER_ERROR),
    ;
    private String code;
    private String msgFormatter;
    private HttpStatus httpStatus;
}
